Skip to content

Conversation

@ktoso
Copy link
Collaborator

@ktoso ktoso commented Oct 8, 2025

This reworks wrap-java on some real usage feedback and use-cases.

We now handle generics better:

  • both super classes may be generic
  • methods may be generic, including generics from a class used on a method level etc.

This caused quite some fallout that needed to be addressed, and is still incomplete; e.g. #436

@ktoso ktoso force-pushed the wip-cleanup-wrapping-java-apis branch from 365c5e4 to 08e221e Compare November 4, 2025 07:01
ktoso added a commit to ktoso/swift-java that referenced this pull request Nov 4, 2025
We had a lot of all-over-the-place logging which pretended to be loggers
or just println + debug and info prefixes etc. This is getting out of
hand and we should adopt a consistent logging mechanism.

The way to do this in Swift is swift-log, there's no reason anymore to
reinvent the wheel about it. The dependency is small and likely to be
present in most libs. Especially the source gen we need not be
concnerned about using swift-log. Runtime does not have to use it.

This is just some initial steps, separated out from swiftlang#397
ktoso added a commit to ktoso/swift-java that referenced this pull request Nov 5, 2025
We had a lot of all-over-the-place logging which pretended to be loggers
or just println + debug and info prefixes etc. This is getting out of
hand and we should adopt a consistent logging mechanism.

The way to do this in Swift is swift-log, there's no reason anymore to
reinvent the wheel about it. The dependency is small and likely to be
present in most libs. Especially the source gen we need not be
concnerned about using swift-log. Runtime does not have to use it.

This is just some initial steps, separated out from swiftlang#397
@ktoso ktoso force-pushed the wip-cleanup-wrapping-java-apis branch 5 times, most recently from dbe5302 to 81b5826 Compare November 10, 2025 15:01
@ktoso ktoso force-pushed the wip-cleanup-wrapping-java-apis branch from 81b5826 to 3b87d8f Compare November 10, 2025 15:09
@ktoso ktoso force-pushed the wip-cleanup-wrapping-java-apis branch from 64c69d7 to 537070f Compare November 11, 2025 03:38
public func getTypeName() -> String

@JavaMethod
public func toString() -> String
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to properly fix this for all interfaces #430

understanding what's going on without being able to get toString of the java types is quite a problem, i'll tackle it next. This is obviously going to be thrown away (the edit in the generated source)

@ktoso ktoso force-pushed the wip-cleanup-wrapping-java-apis branch from 537070f to d81ff4f Compare November 11, 2025 03:43
@ktoso
Copy link
Collaborator Author

ktoso commented Nov 11, 2025

Parking some of the enum fun for later #436

@ktoso
Copy link
Collaborator Author

ktoso commented Nov 12, 2025

This finally resolved the fallout from adding more proper generics support, follow ups to be done in smaller PRs, this big one has been going for far too long.

Going to squash all that and get back into small PRs mode; the fallout of the generics was kinda huge here.

@ktoso ktoso changed the title WIP: Lots of fixes wrapping java APIs wrap-java revamp and add generic methods, types, and supertypes support Nov 12, 2025
@ktoso ktoso marked this pull request as ready for review November 12, 2025 10:32
@ktoso ktoso merged commit f010c8e into swiftlang:main Nov 12, 2025
48 checks passed
@ktoso ktoso deleted the wip-cleanup-wrapping-java-apis branch November 12, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants